#include <iostream>

using namespace std;

template<typename ...T>
T sum(T&&... args)
{
    (cout << "input:" << ... << args ) << endl;
    return (args + ... + 0);
}

int main(int argc, const char *argv[])
{
    int total = 0;

    total = sum(1,2,3,4,5);
    cout << "total:" << total << endl;

    return 0;
}
